package com.example.librarymanagementsystembackend.borrowingmanagement.entity;

import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * 用户借阅记录类
 */
@Data
public class BorrowRecord {
    private Integer id;
    private Integer userId;        // 借阅用户的ID
    private Integer bookId;        // 借阅图书的ID
    private String borrowTime;     // 借书时间（ISO 8601格式）
    private String returnTime;     // 还书时间（ISO 8601格式）（值为`null`则表示书未归还）
    private Integer overdueDays;    // 逾期天数（未逾期时值为`0`）
    private BigDecimal overdueFine; // 逾期费用（未逾期时值为`0`）

    public BorrowRecord() {
    }

    public BorrowRecord(Integer id, Integer userId, Integer bookId, String borrowTime, String returnTime, Integer overdueDays, BigDecimal overdueFine) {
        this.id = id;
        this.userId = userId;
        this.bookId = bookId;
        this.borrowTime = borrowTime;
        this.returnTime = returnTime;
        this.overdueDays = overdueDays;
        this.overdueFine = overdueFine;
    }

    @Override
    public String toString() {
        return "BorrowRecord{" +
                "userId=" + userId +
                ", bookId=" + bookId +
                ", borrowTime='" + borrowTime + '\'' +
                ", returnTime='" + returnTime + '\'' +
                ", overdueDays=" + overdueDays +
                ", overdueFine=" + overdueFine +
                '}';
    }
}